<div class="layui-side layui-bg-black">
	<div class="layui-side-scroll">
		<#include "/apps/business/workorders/include/left.html">
	</div>
</div>
<div class="layui-body">
	<div class="layui-side-scroll">
		<div class="row">
			<div class="col-lg-12">
				<h1 class="site-h1" style="background-color:#FFFFFF;">
					流程列表<#if processList??>（${processList.totalElements!''}）</#if>
					<span style="float:right;">
						<button class="layui-btn layui-btn-sm green" href="/apps/bpm/add.html" data-toggle="ajax" data-width="550" data-height="300" data-title="创建新流程">
							创建新流程
						</button>
					</span>
				</h1>
				<div class="row" style="padding:5px;">
					<div class="col-lg-12">
						<table class="layui-table" lay-skin="line">
						  <colgroup>
								<col width="20%">
								<col width="15%">
								<col width="10%">
								<col width="15%">
								<col width="1%">
								<col>
						  </colgroup>
						  <thead>
							<tr>
							  <th>流程中文标题</th>
							  <th>流程名</th>
							  <th>状态</th>
							  <th>创建时间</th>
							  <th style="white-space:nowrap;" nowrap="nowrap">操作</th>
							</tr> 
						  </thead>
						  <tbody>
							<#if processList?? && processList.content??>
							<#list processList.content as process>
							<tr>
							  <td>
							  	   <a href="/apps/bpm/design.html?id=${process.id!''}">
									${process.title!''}
								   </a>
							  </td>
							  <td>${process.name!''}</td>
							  <td><#if process.published>已发布<#else>未发布</#if></td>
							  <td>${process.createtime?string("yyyy-MM-dd HH:mm:ss")}</td>
							  <td style="white-space:nowrap;" nowrap="nowrap">
							  		<a href="/apps/bpm/edit.html?id=${process.id!''}" data-toggle="ajax"  data-width="550" data-height="300" data-title="编辑网站">
							  			<i class="layui-icon">&#xe642;</i>
							  			编辑
							  		</a>
							  		<#if process.published>
							  		<a href="/apps/bpm/redeploy.html?id=${process.id!''}" style="margin-left:10px;" data-toggle="tip" title="重新发布流程后，流程版本会发生变化，请确认是否重新发布流程？" >
							  			<i class="layui-icon" style="color:red;">&#x1006;</i>
							  			重新发布
							  		</a>
							  		<#else>
							  		<a href="/apps/bpm/deploy.html?id=${process.id!''}" style="margin-left:10px;" data-toggle="tip" title="请确认是否发布流程？" >
							  			<i class="layui-icon" style="color:red;">&#x1006;</i>
							  			发布
							  		</a>
							  		</#if>
							  		<a href="/apps/bpm/delete.html?id=${process.id!''}" style="margin-left:10px;" data-toggle="tip" title="请确认是否删除流程？" >
							  			<i class="layui-icon" style="color:red;">&#x1006;</i>
							  			删除
							  		</a>
							  </td>
							</tr>
							</#list>
							</#if>
						  </tbody>
						</table>
					</div> 	   
				</div>
				<div class="row" style="padding:5px;">
					<div class="col-lg-12" id="page" style="text-align:center;"></div>
				</div>
			</div>	
		</div>
	</div>
</div>

<script>
	layui.use(['laypage', 'layer'], function(){
		  var laypage = layui.laypage
		  ,layer = layui.layer;
		  
		  laypage.render({
				elem: 'page'
				,pages: <#if processList??>${processList.totalPages}<#else>0</#if> //总页数
				,curr:<#if processList??>${processList.number+1}<#else>0</#if>
				,groups: 5 //连续显示分页数
				,jump:function(data , first){
					if(!first){
						location.href = "/apps/bpm/index.html?p="+data.curr ;
					}
				}
		   });
		});
</script>